<template>
  <view class="point-list">
    <view v-if="orderList.length === 0" class="no-img">
      <view class="div1"></view>
      <text>无订单</text>
    </view>
    <template v-else>
      <view class="order" v-for="item in orderList" :key="item.id">
        <view class="top">
          <view class="code">{{ "订单号 " + item.integralOrderNo }}</view>
          <view class="status">已兑换</view>
        </view>
        <view class="middle">
          <view class="imgcon">
            <img :src="item.waresPic" alt="" srcset="" />
          </view>
          <view class="content">
            <view class="title">{{ item.waresName }}</view>
            <view class="desc">{{ item.waresDetail }}</view>
            <view class="amount">
              <view class="div2">
                <text class="text">共{{ item.exchangeNum }}件商品 合计 </text
                ><text class="icon"></text><text>{{ item.integral }}</text>
              </view>
            </view>
          </view>
        </view>
      </view>
    </template>
  </view>
</template>

<script>
export default {
  head() {
    return {
      title: "积分订单",
    };
  },
  data() {
    return {
      orderList: [],
    };
  },

  mounted() {
    this.initOrderList();
  },
  methods: {
    async initOrderList() {
      try {
        const {phoneNumber, enterpriseId} = this;
        const res = await this.$Request({
          url: "/getUserIntegralOrderList",
          method: "GET",
          data: {
            mobilePhone: phoneNumber,
            enterpriseId,
          }
        });

        if (res.retCode === 0) {
          this.orderList = res.data;
        }
      } catch (error) {
        
      }
    },
  },
};
</script>

<style>
.point-list {
  width: 100%;
  background: #f8f8f8;
  width: 700rpx;
  margin: 0 auto;
}
.point-list .no-img {
  width: 100%;
  height: 60vh;
    position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.point-list .no-img .div1 {
  width: 229rpx;
  height: 187rpx;
  background: url("../static/point/wu@2x.png") no-repeat 0 0;
  background-size: 100% 100%;
}
.point-list .no-img text {
  width: 229rpx;
  height: 40rpx;
  font-size: 28rpx;
  font-weight: 500;
  color: #aaaaaa;
  line-height: 40rpx;
  text-align: center;
}
.point-list .order {
  width: 100%;
  background: #ffffff;
  margin-top: 20rpx;
}
.point-list .order .top {
  width: 100%;
  height: 100rpx;
  position: relative;
  border-bottom: 1 solid #e0e0e0;
}
.point-list .order .top .code {
  height: 40rpx;
  font-size: 28rpx;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #666666;
  line-height: 40rpx;
  position: absolute;
  top: 30rpx;
  left: 30rpx;
}
.point-list .order .top .status {
  height: 40rpx;
  font-size: 28rpx;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #666666;
  line-height: 40rpx;
  position: absolute;
  top: 30rpx;
  right: 30rpx;
}

.point-list .order .middle {
  width: 100%;
  height: 400rpx;
  display: flex;
  justify-content: center;
  align-items: center;
}
.point-list .order .middle .imgcon {
  width: 240rpx;
  height: 240rpx;
  background: #ffffff;
  border-radius: 10rpx;
  border: 2rpx solid #eeeeee;
  box-sizing: border-box;
  padding: 30rpx;
  margin-bottom: 100rpx;
}
.point-list .order .middle .imgcon img {
  width: 100%;
  height: 100%;
}
.point-list .order .middle .content {
  width: 448rpx;
  height: 34rpx;
  padding: 30rpx 10rpx;
}
.point-list .order .middle .content .title {
  width: 356rpx;
  height: 45rpx;
  font-size: 32rpx;
  font-family: PingFangSC-Medium, PingFang SC;
  font-weight: 500;
  color: #111111;
  line-height: 45rpx;
}
.point-list .order .middle .content .desc {
  width: 420rpx;
  height: 195rpx;
  font-size: 28rpx;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #666666;
  line-height: 40rpx;
}
.point-list .order .middle .content .amount {
  width: 420rpx;
  height: 100rpx;
  font-size: 32rpx;
  font-family: PingFangSC-Medium, PingFang SC;
  font-weight: 500;
  color: #fe9700;
  line-height: 45rpx;
  position: relative;
}
.point-list .order .middle .content .amount .div2 {
  display: inline-block;
  position: absolute;
  right: 0;
  top: 20rpx;
}
.point-list .order .middle .content .amount .text {
  width: 170rpx;
  height: 33rpx;
  font-size: 24rpx;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #666666;
  line-height: 33rpx;
}
.point-list .order .middle .content .amount .icon {
  display: inline-block;
  width: 25rpx;
  height: 25rpx;
  background: url("../static/point/a01_jifen@2x.png") no-repeat 0 0;
  background-size: 100% 100%;
}
.point-list .order .footer {
  width: 100%;
  height: 100rpx;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.point-list .order .footer .paytime {
  display: inline-block;
  width: 284rpx;
  height: 40rpx;
  font-size: 28rpx;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #aaaaaa;
  line-height: 40rpx;
}
.point-list .order .footer .paybutton {
  display: flex;
  justify-content: space-between;
  width: 340rpx;
}

.point-list .order .footer .paybutton .cancel {
  border: none;
  background-color: transparent;
  outline: none;
  display: block;
  width: 160rpx;
  height: 60rpx;
  border-radius: 30rpx;
  border: 2rpx solid #aaaaaa;
  font-size: 28rpx;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #aaaaaa;
  line-height: 40rpx;
}
.point-list .order .footer .paybutton .pay {
  border: none;
  background-color: transparent;
  outline: none;
  display: block;
  width: 160rpx;
  height: 60rpx;
  background: #fe9700;
  border-radius: 30rpx;
  font-size: 28rpx;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #ffffff;
  line-height: 40rpx;
}
</style>
